package com.basics.framework.security;/*
package com.basics.framework.security;


import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Set;

public class LoginUser implements UserDetails {
    private static final long serialVersionUID = 1L;
    private String token;
    private Long loginTime;
    private Long expireTime;
    private Set<String> permissions;
    private AppUser user;

    public LoginUser() {
    }

    public LoginUser(AppUser user, Set<String> permissions) {
        this.user = user;
        this.permissions = permissions;
    }

    @JsonIgnore
    public String getPassword() {
        return this.user.getUserPassword();
    }

    public String getUsername() {
        return this.user.getUserPhone();
    }

    @JsonIgnore
    public boolean isAccountNonExpired() {
        return true;
    }

    @JsonIgnore
    public boolean isAccountNonLocked() {
        return true;
    }

    @JsonIgnore
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @JsonIgnore
    public boolean isEnabled() {
        return true;
    }

    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    public String getToken() {
        return this.token;
    }

    public Long getLoginTime() {
        return this.loginTime;
    }

    public Long getExpireTime() {
        return this.expireTime;
    }

    public Set<String> getPermissions() {
        return this.permissions;
    }

    public AppUser getUser() {
        return this.user;
    }

    public void setToken(final String token) {
        this.token = token;
    }

    public void setLoginTime(final Long loginTime) {
        this.loginTime = loginTime;
    }

    public void setExpireTime(final Long expireTime) {
        this.expireTime = expireTime;
    }

    public void setPermissions(final Set<String> permissions) {
        this.permissions = permissions;
    }

    public void setUser(final AppUser user) {
        this.user = user;
    }

    public String toString() {
        return "LoginUser(token=" + this.getToken() + ", loginTime=" + this.getLoginTime() + ", expireTime=" + this.getExpireTime() + ", permissions=" + this.getPermissions() + ", user=" + this.getUser() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof LoginUser)) {
            return false;
        } else {
            LoginUser other = (LoginUser)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label71: {
                    Object this$token = this.getToken();
                    Object other$token = other.getToken();
                    if (this$token == null) {
                        if (other$token == null) {
                            break label71;
                        }
                    } else if (this$token.equals(other$token)) {
                        break label71;
                    }

                    return false;
                }

                Object this$loginTime = this.getLoginTime();
                Object other$loginTime = other.getLoginTime();
                if (this$loginTime == null) {
                    if (other$loginTime != null) {
                        return false;
                    }
                } else if (!this$loginTime.equals(other$loginTime)) {
                    return false;
                }

                label57: {
                    Object this$expireTime = this.getExpireTime();
                    Object other$expireTime = other.getExpireTime();
                    if (this$expireTime == null) {
                        if (other$expireTime == null) {
                            break label57;
                        }
                    } else if (this$expireTime.equals(other$expireTime)) {
                        break label57;
                    }

                    return false;
                }

                Object this$permissions = this.getPermissions();
                Object other$permissions = other.getPermissions();
                if (this$permissions == null) {
                    if (other$permissions != null) {
                        return false;
                    }
                } else if (!this$permissions.equals(other$permissions)) {
                    return false;
                }

                Object this$user = this.getUser();
                Object other$user = other.getUser();
                if (this$user == null) {
                    if (other$user == null) {
                        return true;
                    }
                } else if (this$user.equals(other$user)) {
                    return true;
                }

                return false;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof LoginUser;
    }

    public int hashCode() {
        int result = 1;
        Object $token = this.getToken();
        result = result * 59 + ($token == null ? 43 : $token.hashCode());
        Object $loginTime = this.getLoginTime();
        result = result * 59 + ($loginTime == null ? 43 : $loginTime.hashCode());
        Object $expireTime = this.getExpireTime();
        result = result * 59 + ($expireTime == null ? 43 : $expireTime.hashCode());
        Object $permissions = this.getPermissions();
        result = result * 59 + ($permissions == null ? 43 : $permissions.hashCode());
        Object $user = this.getUser();
        result = result * 59 + ($user == null ? 43 : $user.hashCode());
        return result;
    }
}
*/
